package com.yc.chatroom.server.common;

import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import com.yc.chatroom.server.dao.UserRepositoryDao;
import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;

@Configuration
public class SysInit {
	
	private static final Log log = LogFactory.get();
	
	@Autowired
	private UserRepositoryDao userRepositoryDao;

	/**
	 * 启动后把所有人的登录状态改为未登录
	 */
	@PostConstruct
	public void loginStatusInit() {
		log.info("开始初始化...");
		userRepositoryDao.updateLoginStatus();
	}
}
